<template>
    <div class="pdf-master">
      <section :key="group.year" :id="group.year" v-for="(group, index) in examList">
        <h4>{{ group.year }}</h4>
        <div class="year clear-fix" :id="group.year">
          <div class="time" :key="time" v-for="(time, keys) in group.list">
            <h5>
              <span v-html="lightHigh(time)"></span>
              <span class="type_desc" :class="'type-desc-' + group.map[time][0].type">{{ group.map[time][0].examAlias ?
                group.map[time][0].examAlias : group.map[time][0].typeDesc }}</span>
            </h5>
            <div class="group clear-fix" :class="[{ 'setheight': schoolCode == 'DTP918' }]">
              <!-- <a href="javascript:void(0);" title="点击下载" @click="exportAllWord(group.map[time][0], time)">归档报告</a> -->
              <a href="javascript:void(0);" title="点击下载" v-if="group.map[time][0].subject.length !== 0"
                @click="downloadExcel(group.map[time][0].id, group.map[time][0])">成绩册</a>
              <!-- <a href="javascript:void(0);" title="点击下载" v-if="group.map[time][0].inSchoolUrl" @click="downMasterSimplePDF(group.map[time][0])">校长简报</a>
              <a href="javascript:void(0);" title="点击下载" v-if="group.map[time][0].interSchoolUrl" @click="downSchoolClass(group.map[time][0])">校际班级</a>-->
              <a href="javascript:void(0)" v-if="group.map[time][0].subject.length !== 0" title="点击下载"
                @click="MasteRreport(group.map[time][0].id, group.map[time][0])">校长报告</a>
              <a href="javascript:void(0);" title="点击下载" v-if="titles.length > 0"
                @click="downloadall(group.map[time][0].id, index, group.map[time][0], group, time, item)"
                v-for="(item, index) in titles" :key="index">{{ item.title }}</a>
              <a href="javascript:void(0);" v-if="schoolCode == 'YSN123'" title="点击下载"
                @click="downloadassess(group.map[time][0].id, group.map[time][0])">考核表</a>
              <a href="javascript:void(0);"
                v-if="schoolCode !== 'YSN123' && schoolCode !== 'FUO923' && group.map[time][0].subject.length !== 0"
                title="点击下载"
                @click="downloadDZP312(group.map[time][0].id, group.map[time][0], 'LearningDiffList')">学困生</a>
              <!-- 曲阳四小绩效报告 -->
              <a href="javascript:void(0);" v-if="schoolCode === 'PPD081'" title="点击下载"
                @click="downloadJiXiaoPingBi(group.map[time][0])">绩效评比</a>
              <a href="javascript:void(0);" v-if="schoolCode === 'DZP312' && group.map[time][0].subject.length !== 0"
                title="点击下载"
                @click="downloadDZP312(group.map[time][0].id, group.map[time][0], 'TeacherTraceTable')">成绩跟踪</a>
              <!-- <a href="javascript:void(0);" v-if="schoolCode =='YSN123'" title="点击下载"  @click="statisticaltable(group.map[time][0].id)">统计表</a> -->
              <span class="no-link" v-if="group.map[time][0].subject.length === 0">报表生成中...</span>
            </div>
            <div class="subject" v-show="group.map[time][0].subject.length != 0">
              <a href="javascript:void(0);" title="点击下载"
                @click="showSubjectModal(group.map[time][0], index, time)">下载学科分析报告</a>
            </div>
            <!-- <div class="subject" v-show="group.map[time][0].subject.length!=0" style="padding-bottom: 0px;">
              <a href="javascript:void(0);" title="点击下载" @click="exportAllWord(group.map[time][0], time)">下载全部报告</a>
            </div>-->
          </div>
        </div>
      </section>
      <!--弹窗-->
      <el-dialog :visible.sync="isTeacherChange" width="830px" top="100px" :before-close="dialogVisible">
        <div slot="title">
          <div class="is_title">请选择对比的测评</div>
        </div>
        <div class="dialog">
          <div class="is_active_label">
            <div class="is_left">
              <span class="plan" v-if="!(teacherMap.val && teacherMap.val.examAlias)"
                :class="'type-desc-' + (teacherMap.val ? teacherMap.val.type : '')">{{
                teacherMap.val ?
                teacherMap.val.typeDesc :
                '' }}</span>
              <span v-if="!(teacherMap.val && teacherMap.val.examAlias)" class="time">{{ teacherMap.time }}</span>
              <span v-if="teacherMap.val && teacherMap.val.examAlias" class="is_name">{{ teacherMap.val.examAlias
                }}</span>
              <span class="close"></span>
            </div>
            <div class="text">对比</div>
            <div class="is_right">
              <div v-if="!isAddShow">
                <div class="is_up">
                  从下方选择对比的测评
                </div>
              </div>
              <div v-else class="is_left" @click="closeReport">
                <span class="plan" v-if="!reportMap['val'].value.examAlias"
                  :class="'type-desc-' + (reportMap.val ? reportMap.val.value.type : '')">{{
                  reportMap.val
                  ?
                  reportMap.val.value.typeDesc : '' }}</span>
                <span v-if="!reportMap['val'].value.examAlias" class="time">{{ reportMap.time }}</span>
                <span v-if="reportMap.val.value.examAlias" class="is_name">{{ reportMap.val.value.examAlias }}</span>
                <span class="close"><i class="el-icon-close"></i></span>
              </div>
            </div>
          </div>
          <div class="is_content" ref="is_content">
            <div class="is_report" v-for="(item, index) in teacherMap.allList">
              <div class="is_report_label">
                <div class="is_text" :class="isAddShow ? item.isActive ? '' : 'is_text_not' : ''">
                  {{ index }}
                </div>
                <div class="is_icon">
                  <i class="el-icon-caret-right"></i>
                </div>
              </div>
              <div class="is_content_flex">
                <div class="is_left mar_right" :class="isAddShow ? chir.isActive ? 'is_active' : 'not_active' : ''"
                  v-for="chir in item" :key="chir.value.id" :label="chir.label" @click="addReport(item, chir)">
                  <span v-if="!chir.value.examAlias" class="plan" :class="'type-desc-' + chir.value.type">{{
                    chir.value.typeDesc
                    }}</span>
                  <span v-if="!chir.value.examAlias" class="time">{{ chir.label }}</span>
                  <span v-if="chir.value.examAlias" class="is_name">{{ chir.value.examAlias }}</span>
                  <span class="add">
                    <i v-if="!isAddShow" class="el-icon-plus"></i>
                    <div v-if="isAddShow && chir.isActive" class="check_active">
                      <i class="el-icon-close"></i>
                    </div>
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>
        <span slot="footer" class="dialog-footer">
          <div class="footer_text">
            {{ isAddShow ? '确定对比的测评，点确定' : '请选择与之对比的测评' }}
          </div>
          <div class="footer_button">
            <el-button class="is_close" @click="dialogVisible">取 消</el-button>
            <el-button class="is_success" type="primary" @click="uploadTeacherExcel('one')">确 定</el-button>
          </div>
        </span>
      </el-dialog>
      <!--新多选弹窗-->
      <el-dialog :visible.sync="isAllSelectShow" width="830px" top="100px" :before-close="allDialogVisible">
        <div slot="title">
          <div class="is_title">请选择测评</div>
        </div>
        <div class="dialog">
          <div class="is_content is_all_content" ref="is_content">
            <div class="is_report" v-for="(item, index) in allList">
              <div class="is_report_label">
                <div class="is_text" :class="item.isActive ? '' : 'is_text_not'">
                  {{ index }}
                </div>
                <div class="is_icon">
                  <i class="el-icon-caret-right"></i>
                </div>
              </div>
              <div class="is_content_flex">
                <div class="is_left mar_right" :class="chir.isActive ? 'is_active' : 'not_active'" v-for="chir in item"
                  :key="chir.value.id" :label="chir.label" @click="allAddReport(item, chir)">
                  <span v-if="!chir.value.examAlias" class="plan" :class="'type-desc-' + chir.value.type">{{
                    chir.value.typeDesc
                    }}</span>
                  <span v-if="!chir.value.examAlias" class="time">{{ chir.label }}</span>
                  <span v-if="chir.value.examAlias" class="is_name">{{ chir.value.examAlias }}</span>
                  <span class="add">
                    <div v-if="chir.isActive" class="check_active">
                      <i class="el-icon-close"></i>
                    </div>
                    <i v-else class="el-icon-plus"></i>
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>
        <span slot="footer" class="dialog-footer">
          <div class="footer_text">
          </div>
          <div class="footer_button">
            <el-button class="is_close" @click="allDialogVisible">取 消</el-button>
            <el-button class="is_success" type="primary" @click="uploadTeacherExcel('all')">确 定</el-button>
          </div>
        </span>
      </el-dialog>
      <MyDialog :show="showDialog" :width="400" :title="'请选择相应的学科进行下载'" @close="showDialog = false"
        @confirm="downSubject">
        <template #header>
          <div class="filter">
            <el-dropdown trigger="click" placement="bottom-start">
              <div class="filterWrap">
                <img src="@/assets/img/filter.png" alt="" class="filterimg" />
                <span class="Text">({{ getCount(examList[currents.index].map[currents.time][0].select) }})</span>
              </div>
              <template #dropdown>
                <el-dropdown-menu>
                  <div class="genzon">选择跟踪的测评</div>
                  <div style="width:150px;padding-left: 15px">
                    <div v-for="(checkItem, chekidx) in  examList[currents.index].map[currents.time][0].select"
                      :key="chekidx" class="selectItem">
                      <el-checkbox :label="checkItem.desc" v-model="checkItem.active" @change="changesingle" />
                    </div>
                    <div class="selectItem">
                      <el-checkbox label="全选" :value="allSelect(examList[currents.index].map[currents.time][0].select)"
                        @change="changeSelect($event, examList[currents.index].map[currents.time][0].select)" />
                    </div>
                  </div>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
          </div>
        </template>
        <div class="dialog">
          <!--<span :class="{selected: subject.selected}" @click="selectSubject(subject)" :key="subject.name" v-for="subject in subjects">{{ subject.name }}</span>-->
          <div class="item" :key="subject.name" v-for="subject in subjects" @click="selectSubject(subject)">
            <span :class="['shadow-' + imgMap[removefix(subject.name)].id, { selected: subject.selected }]">
              <img class="subject" :src="imgMap[removefix(subject.name)].reportUrl" alt />
              <img class="yes" src="../../assets/img/yes-green.png" alt />
            </span>
            <p class="content">{{ subject.name }}</p>
          </div>
          <!-- 学困部分 -->
          <!-- <div>
            <div class="item" :key="subject.name" v-for="subject in subjects" @click="selectSubject(subject)">
              <span :class="['shadow-' + imgMap[subject.name].id, { selected: subject.selected }]">
                <img class="subject" :src="imgMap[subject.name].reportUrl" alt />
                <img class="yes" src="../../assets/img/yes-green.png" alt />
              </span>
              <p class="content">{{ subject.name }}学困</p>
            </div>
          </div> -->
        </div>
      </MyDialog>
      <MyDialog :show="showResults" :width="-1" @close="showResults = false" :title="title" @confirm="isconfirmHandler">
        <div class="dialog-content">
          <span class="selectedindex" :class="{ selected: dlType.includes('old-excel') }"
            @click="isSelectXsl('old-excel', '成绩册(合并版)')">
            <div class="wi excel"></div>
            <b class="olderes">成绩册(合并版)</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="schoolCode === 'GFA735'" class="selectedindex"
            :class="{ selected: dlType.includes('collect-excel') }" @click="isSelectXsl('collect-excel', '汇总')">
            <div class="wi excel"></div>
            <b>汇总</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="showmerit" :class="{ selected: dlType.includes('excel-l') }" @click="isSelectXsl('excel-l', '等第册')">
            <div class="wi excel"></div>
            <b>等第册</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="showreport" :class="{ selected: dlType.includes('excel-s') }"
            @click="isSelectXsl('excel-s', '点数册')">
            <div class="wi excel"></div>
            <b>点数册</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="schoolCode === 'DGN579'" :class="{ selected: dlType.includes('excel-h') }"
            @click="isSelectXsl('excel-h', '学期成绩详情')">
            <div class="wi excel"></div>
            <b>学期成绩详情</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="schoolCode === 'DGN579'" :class="{ selected: dlType.includes('excel-i') }"
            @click="isSelectXsl('excel-i', '成绩汇总')">
            <div class="wi excel"></div>
            <b>成绩汇总</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span :class="{ selected: dlType.includes('excel-Al') }" @click="isSelectXsl('excel-Al', '缺考名单')">
            <div class="wi excel"></div>
            <b>缺考名单</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="user.schoolCode == 'UNB114'" :class="{ selected: dlType.includes('excel-cls') }"
            @click="isSelectXsl('excel-cls', '质量分析汇总')">
            <div class="wi excel"></div>
            <b>质量分析汇总</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
          <span v-if="downloadIconsList.length >= 1" v-for="(item, index) in downloadIconsList" :key="index"
            :class="{ selected: dlType.includes('icons' + index) }" @click="onClickIcons(item, index)">
            <div :class="[item.icons === 1 ? 'wi excel' : item.icons === 3 ? 'wi zip' : 'wi word']"></div>
            <b>{{ item.fileName }}</b>
            <img class="yes" src="../../assets/img/yes-green.png" alt />
          </span>
        </div>
      </MyDialog>
      <smsverification :iponesf="iponesf" @downonesdata="downonesdata" @imgscloesd="imgcloeevent" v-if="showQrcode">
      </smsverification>
      <!-- <CustomQrc v-if="showQrcode" @close="showQrcode=false" @masterpdf="masterpdf" :text="text"></CustomQrc> -->
    </div>
  </template>
  <script>
  import CustomQrc from '../custom/CustomQrcode'
  import MyDialog from '../custom/Dialog'
  import separateByYMD from '@/mixins/separate.mixin.js'
  import smsverification from './smsverification'
  import { mapState } from 'vuex'
  export default {
    props: {
      isScroll: false,
      ygurl: Array,
      titles: Array
    },
    inject: ['reload'],
    mixins: [separateByYMD],
    components: { MyDialog, CustomQrc, smsverification },
    data: () => ({
      imgMap: null,
      title: '',
      text: '',
      showreport: false,
      showmerit: false,
      showResults: false,
      isTeacherChange: false,
      isAllSelectShow: false,
      selectList: [],
      dlType: [],
      LOAD: 1,
      REFRESH: 0,
      examList: null,
      subjects: [],
      currentExam: null,
      isAllshow: false,
      showDialog: false,
      tempExamList: [], // 缓存数据
      tagId: '',
      allList: [],
      showQrcode: false,
      testinfo: Object,
      testId: '',
      step: 0,
      schoolCode: '',
      iponesf: '', // 存储需要验证的手机
      ischeckPhoneQrcode: false, // 点击下载判断验证码是否过期
      oldtimes: '',
      itemWidths: 0,
      iconsIndex: [],
      objectDatas: {},
      downloadIconsList: [], // 请求拿到下载按钮
      selectold: '',//记录按钮点击
      user: null,
      teacherMap: {},
      reportMap: {},
      isAddShow: false,
      nameList: [],
      typesList: [], // 考试类型
      currents: { index: 0, time: 'XXXXX' },
    }),
    async created() {
      this.user = this._util.getUser()
      try {
        await this.findTypes()
      } catch (err) {
        this.$message.error(err)
      }
      this.dataRGBRequest()
      this.findMasterData(this.REFRESH)
      this.schoolCode = this._util.getUser().schoolCode
      this.$store.commit('monitorrouter', 'principalbaogao')
      // 成绩册弹框宽度设定
      if (this.schoolCode === 'DGN579') {
        this.itemWidths = 550
        // this.itemWidths = 400
      } else {
        this.itemWidths = 400
      }
      if (this.schoolCode === 'GFA735') {
        this.itemWidths = 550
      }
      if (this.schoolCode === 'UNB114') {
        this.itemWidths = 550
      }
    },
  
    computed: {
      ...mapState(['Gradebook', 'isisverifyInsideAccount', 'nums', 'monitorrouter']),
  
    },
    watch: {
      isScroll: function (newValue, oldValue) {
        if (newValue) {
          this.findMasterData(this.LOAD)
        }
      },
      storageStatus: {
        handler(newVal, oldVal) {
          this.schoolCode = this._util.getUser().schoolCode
          // this.reload()
          // this.findMasterData(this.REFRESH)
        },
        deep: true
      }
    },
    methods: {
      allSelect(selects) {
        return selects.every(item => item.active)
      },
      changesingle() {
        this.$forceUpdate()
      },
      changeSelect(flag, selects) {
        selects.forEach(item => item.active = flag)
        this.$forceUpdate()
      },
      getCount(selects) {
        let flag = selects.every(item => item.active)
        if (flag) return '全部'
        else return selects.filter(item => item.active).length
      },
      // 查询考试类型
      findTypes() {
        return new Promise((resolve, reject) => {
          let url = `utilControl/findTypes?schoolCode=${this._util.getUser().schoolCode}`
          this.$http.get(url).then(response => {
            let body = response.body
            if (body.status === 1) {
              body.result.forEach(item => {
                item.active = true
              })
              this.typesList = body.result
              resolve(1)
            } else {
              reject('请求状态出,请检查参数后再试')
            }
          }).catch(err => {
            reject(err)
          })
        })
      },
      onClickIcons(item, index) {
        let indexs = this.dlType.findIndex(el => el === 'icons' + index)
        if (indexs !== -1) this.dlType.splice(indexs, 1)
        else this.dlType.push('icons' + index)
  
        let indexss = this.iconsIndex.findIndex(el => el === index)
        if (indexs !== -1) this.iconsIndex.splice(indexss, 1)
        else this.iconsIndex.push(index)
  
        let nameIndex = this.nameList.findIndex(el => el === item.fileName)
        if (indexs !== -1) this.nameList.splice(nameIndex, 1)
        else this.nameList.push(item.fileName)
      },
      dataRGBRequest() {
        const url = '/cloud/base/tag/getRGBBySubName'
        this.$http.get(url).then(res => {
          const body = res.body
          if (body.status === 1 && Object.keys(body.result).length) {
            sessionStorage.setItem('RGBMap', JSON.stringify(body.result))
          } else {
            sessionStorage.setItem('RGBMap', JSON.stringify(IMG_MAP_ID))
          }
          this.imgMap = JSON.parse(sessionStorage.getItem('RGBMap'))
        })
      },
      // 考核表
      downloadassess(id, val) {
        let urlAssessment = 'schoolExamSet/check/judgeJointData'
        let paramsAssessment = {
          schoolExamSetId: id
        }
        this.$http.post(urlAssessment, paramsAssessment).then(res => {
          if (res.body.status === 1) {
            let url = ''
            let user = this._util.getUser()
  
            // let params = {
            //   id
            // }
            // this.minitorRequest(this._url.excel.exportJYFZSchool, params)
            const baseURL = this.$baseUrl
            val.examTime = val.examTime.split(' ')[0]
            let keys = `${user.schoolName}${val.examTime}${val.typeDesc}${user.schoolCode}.xls`
            url = `${baseURL}/${this._url.excel.exportJYFZSchool}?id=${id}&userKey=${user.userKey}&Key=${keys}`
            this.$loading.show()
            var self = this
            this.$emit('download', url, function () {
              self.$loading.hide()
            })
            // this.download(url)
          } else {
            this.$_toast.error(res.body.message)
          }
        })
        // let url = ''
        // let user = this._util.getUser()
        // console.log(user, 'user')
        // let params = {
        //   id
        // }
        // this.minitorRequest(this._url.excel.exportJYFZSchool, params)
        // const baseURL = this.$baseUrl
        // url = `${baseURL}/${this._url.excel.exportJYFZSchool}?id=${id}&userKey=${user.userKey}`
        // this.download(url)
      },
      downloadJiXiaoPingBi(data) {
        let user = this._util.getUser()
        let baseURL = this.$baseUrl
        let url = 'excel/downloadQualityPerformance'
        this.$loading.show()
        let targetUrl = `${baseURL}/${url}?schoolExamSetId=${data.id}&userKey=${user.userKey}`
        var self = this
        this.$emit('download', targetUrl, function () {
          self.$loading.hide()
        })
      },
      downloadDZP312(id, val, type) {
        let obj = {
          'LearningDiffList': 'excel/exportLearningDiffList',
          'TeacherTraceTable': 'excel/exportTeacherTraceTable'
        }
        let user = this._util.getUser()
        this.$loading.show()
        const baseURL = this.$baseUrl
        const url = obj[type]
        let targetUrl = `${baseURL}/${url}?schoolExamSetId=${id}&userKey=${user.userKey}`
        var self = this
        this.$emit('download', targetUrl, function () {
          self.$loading.hide()
        })
      },
      changeYearData(list) {
        const groupedArr = list.reduce((acc, curr) => {
          const key = curr.year;
          if (!acc[key]) acc[key] = [];
          acc[key].push(curr);
          return acc;
        }, {});
        return groupedArr
      },
      closeReport() {
        this.reportMap.par.isActive = false
        this.reportMap.val.isActive = false
        this.reportMap = {}
        this.isAddShow = false
        this.selectold = ''
      },
      addReport(par, item) {
        if (this.selectold && this.selectold !== item.label) return
        this.selectold = item.label
        // console.log('数据源',par, item);
        if (this.isAddShow) return this.closeReport()
        this.reportMap.val = item
        this.reportMap.time = item.label
        this.reportMap.par = par
        par.isActive = true
        item.isActive = true
        this.isAddShow = true
      },
      allAddReport(par, item) {
        item.isActive = !item.isActive
        let bole = false
        for (let i = 0; i < par.length; i++) {
          if (par[i].isActive) bole = true
        }
        par.isActive = bole
        const index = this.selectList.findIndex(el => el.value.id === item.value.id)
        if (index !== -1) this.selectList.splice(index, 1)
        else this.selectList.push(item)
      },
      dialogVisible() {
        this.isTeacherChange = false
        this.closeReport()
      },
      allDialogVisible() {
        this.isAllSelectShow = false
      },
      // 成绩汇总
      downloadall(id, index, val, item, time, chir) {
        let list = []
        let allList = []
        this.examList.forEach(el => {
          for (let key in el.map) {
            let times = new Date(time).getTime()
            let newTimes = new Date(key).getTime()
            if (el.year.slice(0, 4) === item.year.slice(0, 4)) {
              if (newTimes < times) list.push({ label: key, value: el.map[key][0], year: el.year, isActive: false })
            }
            if (chir.type === 1 || newTimes < times) allList.push({ label: key, value: el.map[key][0], year: el.year, isActive: false })
          }
        })
        this.teacherMap = {}
        this.isReport = ''
        this.teacherMap.id = id
        this.teacherMap.index = index
        this.teacherMap.val = val
        this.teacherMap.time = time
        this.teacherMap.list = JSON.parse(JSON.stringify(this.changeYearData(list)))
        this.teacherMap.allList = JSON.parse(JSON.stringify(this.changeYearData(allList)))
        this.allList = JSON.parse(JSON.stringify(this.changeYearData(allList)))
        this.isAllshow = !Object.keys(this.teacherMap.list).length
        this.reportMap = {}
        let cont = this.$refs.is_content
        if (cont) cont.scrollTop = 0
        if (chir.type === 1) {
          this.isAllSelectShow = true
        } else {
          this.isTeacherChange = true
        }
        this.isAddShow = false
      },
      uploadTeacherExcel(type) {
        let url = ''
        const user = this._util.getUser()
        const baseURL = this.$baseUrl
        if (type === 'all') {
          if (!this.selectList.length) return this.$message({ message: '请选择测评!', type: 'warning' });
          let examSetIds = []
          this.selectList.forEach(el => {
            examSetIds.push(el.value.id)
          })
          url = `${baseURL}/${this.ygurl[this.teacherMap.index]}?examSetIds=${examSetIds.join()}&userKey=${user.userKey}`
        } else {
          if (!this.reportMap['val']) return this.$message({ message: '请选择需要对比的测评!', type: 'warning' });
          let preId = ''
          this.examList.forEach(el => {
            for (let key in el.map) {
              if (this.reportMap['val'].label === key) preId = el.map[key][0].id
            }
          })
          this.$loading.show()
          this.teacherMap.val.examTime = this.teacherMap.val.examTime.split(' ')[0]
          let keys = `${user.schoolName}${this.teacherMap.val.examTime}${this.teacherMap.val.typeDesc}${user.schoolCode}.docx`
          url = `${baseURL}/${this.ygurl[this.teacherMap.index]}?id=${this.teacherMap.id}&preId=${preId}&userKey=${user.userKey}&Key=${keys}`
        }
        var self = this
        this.$emit('download', url, function () {
          self.$loading.hide()
          if (type === 'all') self.isAllSelectShow = false
          else self.isTeacherChange = false, self.closeReport()
          
        })
      },
      // 统计表
      statisticaltable(id) {
        let url = ''
        let user = this._util.getUser()
        let params = {
          id
        }
        this.minitorRequest('excel/exportJYFZ', params)
        const baseURL = this.$baseUrl
        url = `${baseURL}/excel/exportJYFZ?id=${id}&userKey=${user.userKey}`
        this.download(url)
      },
      // 校长简报
      downMasterSimplePDF(item) {
        let fileName = item.inSchoolUrl.split('/')[item.inSchoolUrl.split('/').length - 1]
        let url = item.inSchoolUrl + '?&time=' + new Date().getTime() + '&key=' + fileName
        this.download(url)
      },
      // 校际班级
      downSchoolClass(item) {
        let fileName = item.interSchoolUrl.split('/')[item.interSchoolUrl.split('/').length - 1]
        let url = item.interSchoolUrl + '?&key=' + fileName
        this.download(url)
      },
      // 学校成绩册
      downloadExcel(id, item) {
        this.$nextTick(() => {
          const params = {
            type: 2,
            schoolExamSetId: this.tagId,
            schoolCode: this.schoolCode
          }
          this.$http.post('reportFile/downloadReportShow', params).then(response => {
            if (response.data.status === 1) {
              this.downloadIconsList = response.data.result
            }
          })
          this.downloadIconsList.length >= 1 ? this.itemWidths = 550 : ''
        })
        this.objectDatas = item
        this.tagId = id
        this.iponesf = ''
        this.showResults = false
        this.testinfo = item
        this.testId = id
        // isisverifyInsideAccount 为真是白名单登录  不为真账号密码登录 或验证码登录
        if (this.isisverifyInsideAccount === true) {
          let url = 'utilControl/check/checkPhoneQrcode'
          this.$http.get(url).then(res => {
            if (res.body.result === '1') {
              this.iponesf = this._util.getUser().phone
              this.showQrcode = false
              this.masterpdf()
              this.showResults = true
              this.ischeckPhoneQrcode = true // 等于1可以直接下载
            } else if (res.body.result === '0') {
              // let uum = 60
              // if (this.nums === 0) {
              //   this.$store.commit('numsnums', uum)
              // } else {
              //   uum = this.nums
              // }
              this.iponesf = this.Gradebook
              this.showQrcode = true
              this.ischeckPhoneQrcode = false // 等于0重新验证
            }
          })
        } else {
          let url = 'utilControl/check/checkPhoneQrcode'
          this.$http.get(url).then(res => {
            if (res.body.result === '1') {
              this.iponesf = this._util.getUser().phone
              this.showQrcode = false
              this.showResults = true
              this.masterpdf()
              this.ischeckPhoneQrcode = true // 等于1可以直接下载
            } else if (res.body.result === '0') {
              this.iponesf = this._util.getUser().phone
              this.showQrcode = true
              this.ischeckPhoneQrcode = false // 等于0验证码下载
            }
          })
        }
        // let url = 'utilControl/check/checkPhoneQrcode'
        // this.$http.get(url).then(res => {
        //   if (res.body.result === '1') {
  
        //   } else if (res.body.result === '0') {
  
        //   }
        // })
        // this.$loading.hide()
        // this.testinfo = item
        // this.testId = id
        // let url = 'utilControl/check/checkQrcode'
        // this.$http.get(url).then(res => {
        //   if (res.body.status === 1) {
        //     let result = res.body.result
        //     if (result === '2') {
        //       this.showQrcode = false
        //       this.showResults = true
        //       this.masterpdf()
        //       return
        //     }
        //     if (result === '1' || result === '0') {
        //       this.showQrcode = true
        //       this.showResults = false
        //     }
        //   }
        // })
        // var conmand = {
        //   type: 1,
        //   objectId: id
        // }
        // let parmas = {
        //   command: JSON.stringify(conmand),
        //   param: '1',
        //   title: '网页版请求下载确认',
        //   desc: '确认'
        // }
        // this.text = JSON.stringify(parmas)
      },
      // 获取当前的时间戳
      // 关闭验证码弹框
      imgcloeevent() {
        this.showQrcode = false
        // let ones = new Date().toLocaleTimeString()
        // 每次点击叉号都会记录下离开的时间
        let d = new Date()
        let newDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()
        this.$store.commit('storeoldhoures', newDate)
      },
      // 验证码正确
      downonesdata(val) {
        this.masterpdf()
        this.showQrcode = false
        this.showResults = true
      },
      masterpdf() {
        this.showQrcode = false
        this.showResults = true
        let timer = this.testinfo.examTime.substr(0, 10)
        this.title = timer.replace(/-/g, '') + this.testinfo.typeDesc + '成绩册'
        this.tagId = this.testId
        let url = 'excel/check/judgeScoreExcel'
        let params = {
          id: this.testId
        }
        this.$http.post(url, params).then(res => {
          if (res.body.status === 1) {
            this.showResults = true
            this.showreport = res.body.result.score
            this.showmerit = res.body.result.rank
          }
        })
      },
      isSelectXsl(type, name) {
        let index = this.dlType.findIndex(el => el === type)
        if (index !== -1) this.dlType.splice(index, 1)
        else this.dlType.push(type)
  
        let indexs = this.nameList.findIndex(el => el === name)
        if (indexs !== -1) this.nameList.splice(indexs, 1)
        else this.nameList.push(name)
      },
      // 判断验证码是否过期
      isconfirmHandler() {
        let url = 'utilControl/check/checkPhoneQrcode'
        // 判断登陆的身份
        if (this.isisverifyInsideAccount === true) {
          this.$http.get(url).then(res => {
            if (res.body.result === '1') {
              this.iponesf = this._util.getUser().phone
              this.getUrlList()
              this.ischeckPhoneQrcode = true // 等于1可以直接下载
            } else if (res.body.result === '0') {
              this.iponesf = this.Gradebook
              this.ischeckPhoneQrcode = false // 等于0重新验证
              this.$_toast.error('验证码已过期请重新验证!')
              this.showResults = false
              this.showQrcode = true
            }
          })
        } else {
          this.$http.get(url).then(res => {
            if (res.body.result === '1') {
              this.iponesf = this._util.getUser().phone
              this.ischeckPhoneQrcode = true // 等于1可以直接下载
              this.getUrlList()
            } else if (res.body.result === '0') {
              this.iponesf = this._util.getUser().phone
              this.ischeckPhoneQrcode = false // 等于0验证码下载
              this.$_toast.error('验证码已过期请重新验证!')
              this.showResults = false
              this.showQrcode = true
            }
          })
        }
      },
      getUrlList() {
        if (!this.dlType.length) return this.$_toast.info('至少选择一个成绩册')
        let urlList = []
        for (let i = 0; i < this.dlType.length; i++) {
          let url = this.confirmHandler(this.dlType[i])
          urlList.push({ url })
        }
        this.showResults = false
        // 模拟下载
        this.$loading.show()
        var self = this
        if (urlList.length === 1) {
          this.$emit('download', urlList[0].url, function () {
            self.$loading.hide()
          })
        } else {
          let title = this.testinfo.examTime.substring(5, 10) + '-' + this.testinfo.typeDesc + '-' + this.nameList.join()
          urlList.forEach(el => {
            let times = (new Date()).getTime()
            let appids = 'YXUER_WEB'
            let param = el.url.substr(el.url.indexOf('?') + 1, el.url.length)
            let isUrl = el.url.substr(0, el.url.indexOf('?')) + '?appId=' + appids + '&' + '?vtime=' + times + '&' + encodeURI(param)
            el.url = isUrl
          })
          this.$emit('batchDownLoadZip', urlList, title, function () {
            self.$loading.hide()
          })
        }
        this.dlType = []
        this.nameList = []
      },
      confirmHandler(dlType) {
        this.$loading.show()
        let url = ''
        let params = {}
        let user = this._util.getUser()
        const baseURL = this.$baseUrl
        params = {
          id: this.tagId
        }
        let timer = this.testinfo.examTime.substr(0, 10)
        var thisTime = this.testinfo.examTime
        thisTime = thisTime.replace(/-/g, '/')
        var Newstime = new Date(thisTime)
        Newstime = Newstime.getTime()
        let typesname = ''
        let keys = ''
        if (this.iconsIndex.length && dlType.indexOf('icons') !== -1) {
          url = baseURL + this.downloadIconsList[this.iconsIndex[0]].url
          this.iconsIndex.splice(0, 1)
        }
        if (dlType === 'old-excel') {
          typesname += '-成绩册'
        } else if (dlType === 'excel-s') {
          typesname += '-点数册'
        } else if (dlType === 'excel-l') {
          typesname += '-等第册'
        } else if (dlType === 'excel-h') {
          typesname += '-学期成绩详情'
        } else if (dlType === 'excel-i') {
          typesname += '-成绩汇总'
        } else if (dlType === 'excel-Al') {
          typesname += '-缺考名单'
        } else if (dlType === 'collect-excel') {
          typesname += '-汇总'
        }
        if (dlType === 'excel-cls') { // 年级科目报告
          url = `${baseURL}/schoolExamSet/exportGroupSituation/?schoolExamSetId=${this.tagId}&userKey=${user.userKey}`
        }
        keys = `${user.schoolName}${timer.replace(/-/g, '')}${this.testinfo.typeDesc}${user.schoolCode}${typesname}.xls`
        // let keys = user.schoolName + timer.replace(/-/g, '') + this.testinfo.typeDesc + user.schoolCode + typesname + '.xls'
        if (dlType === 'excel-s') { // 分数
          // 模拟
          // this.minitorRequest(this._url.excel.exportScoreExcel, params)
          url = `${baseURL}/${this._url.excel.exportScoreExcel}?id=${this.tagId}&userKey=${user.userKey}&key=${keys}`
        } else if (dlType === 'excel-l') { // 等第
          // 模拟
          // this.minitorRequest(this._url.excel.exportRankExcel, params)
          url = `${baseURL}/${this._url.excel.exportRankExcel}?id=${this.tagId}&userKey=${user.userKey}&key=${keys}`
        } else if (dlType === 'old-excel') { // 老版分数册
          // this.minitorRequest(this._url.excel.newScoreExport, params)
          url = `${baseURL}/${this._url.excel.newScoreExport}?id=${this.tagId}&userKey=${user.userKey}&key=${keys}`
        } else if (dlType === 'excel-h') { // 老版分数册
          // this.minitorRequest(this._url.excel.newScoreExport, params)
          url = `${baseURL}/${this._url.excel.exportStudentAchievement}?examTime=${Newstime}&schoolCode=${user.schoolCode}&userKey=${user.userKey}&key=${keys}`
        } else if (dlType === 'excel-i') { // 老版分数册
          // this.minitorRequest(this._url.excel.newScoreExport, params)
          url = `${baseURL}/${this._url.excel.userExamexportScoreSummary}?id=${this.tagId}&userKey=${user.userKey}&key=${keys}`
        } else if (dlType === 'excel-Al') { // 缺考名单
          let time = new Date(this.objectDatas.examTime).getTime()
          // this.minitorRequest(this._url.excel.newScoreExport, params)
          url = `${baseURL}/${this._url.excel.schoolExamSetexportLackExamStudent}?schoolCode=${user.schoolCode}&examTime=${time}&userKey=${user.userKey}&key=${keys}`
        } else if (dlType === 'collect-excel') { // 汇总
          url = this.$baseUrl + `/schoolExamSet/exportSchoolSummary?schoolExamSetId=${this.tagId}&userKey=${user.userKey}`
        }
        return url
      },
      selectSubject(subject) {
        subject.selected = !subject.selected
      },
      // newas () {
      //   getOperateDownload(id).then(res => {
      //     const url = window.URL.createObjectURL(new Blob([res]))
      //     const link = document.createElement('a')
      //     link.style.display = 'none'
      //     link.href = url
      //     link.setAttribute('download', name.attachName)
      //     document.body.appendChild(link)
      //     link.click()
      //     document.body.removeChild(link)
      //     window.URL.revokeObjectURL(url)
      //   }).catch(error => {
      //     console.log(error)
      //   })
      //   const ele = document.createElement("a");
      //   ele.download = val.docName;
      //   ele.href =
      //     this.doc_url + "/api-file/v1/file/downloadFile?filePath=" + val.docPath;
      //   ele.download = val.docName;
      //   ele.click();
      // },
      // 科目下载
      batchDownLoadZip(item, types) {
        let exam = this.currentExam
        let user = this._util.getUser()
        if (item.name === '汇总') {
          const baseUrl = this.$baseUrl + '/schoolExamSet/exportSchoolSummary?schoolExamSetId=' + exam.id
          return baseUrl
        } else {
          // 2020-10-19 00:00:00
          let datas = exam.examTime.replace(/-/g, '/')
          let timePoint = new Date(datas).Format('yyyy-MM-dd')
          let times = new Date(datas)
          let stringes = times.getTime().toString()
          let filename =  ''
          let baseUrl = ''
          if (item.name.indexOf('学困') > -1) {
            filename = `${user.schoolName}${timePoint}${exam.typeDesc}-${item.name}.xls`
            baseUrl = this.$baseUrl + '/newExcel/studentTrendChart'
          } else {
            `${user.schoolName}${timePoint}${exam.typeDesc}-${item.name}.docx`
            baseUrl = this.$baseUrl + '/word/check/exportSchoolGrades'
            // if(types) baseUrl = baseUrl + `?types=${types}&`
          }
          // const baseUrl  = this.$baseUrl + '/exportWord/studentTrendChart'
          console.log(exam.examTime, 'exam.examTime')
          // if (exam.examTime.replace(/-/g)) {
          if (exam.examTime.indexOf('-') >= 0) {
            console.log(stringes, '--=-=-=--')
          } else {
            let onestit = ''
            onestit = ''
            onestit = exam.examTime.split(' ')[0]
            let oness = onestit.substr(0, 4) + '-' + onestit.substr(4, 2) + '-' + onestit.substr(6, 2) + ' ' + exam.examTime.split(' ')[1]
            exam.examTime = oness
          }
          let requestUrl = `${baseUrl}?userKey=${user.userKey}&schoolCode=${exam.schoolCode}&subject=${this.removefix(item.name)}&examTime=${exam.examTime}&key=${filename}`
          if (requestUrl.includes('/word/check/exportSchoolGrades')) {
            requestUrl = requestUrl = `${baseUrl}?userKey=${user.userKey}&schoolCode=${exam.schoolCode}&subject=${this.removefix(item.name)}&examTime=${exam.examTime}&types=${types}&key=${filename}`
          }
          // this.minitorRequest('word/check/exportSchoolGrades', { 'schoolCode': exam.schoolCode, subject: item.name, examTime: exam.examTime })
          return requestUrl
          // this.$emit('download', requestUrl)
        }
      },
      downSubject() {
        let item = []
        let urlList = []
        let nameList = []
        let types = ''
        const self = this
        this.subjects.forEach(el => {
          if (el.selected) item.push(el), nameList.push(el.name)
        })
        let selects = this.examList[this.currents.index].map[this.currents.time][0].select.filter(item => item.active).map(item => item.type)
        if (selects) types = selects.join(',')
        if (!item.length) return this.$_toast.info('至少选择一个学科')
        item.forEach(el => {
          let url = this.batchDownLoadZip(el, types)
          urlList.push({ url })
        })
        let title = this.currentExam.examTime.substring(5, 10) + "-" + nameList.join()
        self.$loading.show()
        if (urlList.length === 1) {
          this.$emit('download', urlList[0].url, function () {
            self.$loading.hide()
          })
        } else {
          urlList.forEach(el => {
            let times = (new Date()).getTime()
            let appids = 'YXUER_WEB'
            let param = el.url.substr(el.url.indexOf('?') + 1, el.url.length)
            let isUrl = el.url.substr(0, el.url.indexOf('?')) + '?appId=' + appids + '&' + '?vtime=' + times + '&' + encodeURI(param)
            el.url = isUrl
          })
          this.$emit('batchDownLoadZip', urlList, title, function () {
            self.$loading.hide()
          })
        }
        this.showDialog = false
      },
      MasteRreport(id, val) {
        var self = this
        this.$loading.show()
        let url = ''
        let user = this._util.getUser()
        // let params = {
        //   schoolExamSetId: id
        // }
        // this.minitorRequest(this._url.word.exportSchoolReport, params)
        const baseURL = this.$baseUrl
        let examTime = JSON.parse(JSON.stringify(val.examTime))
        examTime = examTime.replace(/-/g, '')
        let keys = `${user.schoolName}${examTime}${val.typeDesc}${user.schoolCode}.docx`
        url = `${baseURL}/${this._url.word.exportSchoolReport}?schoolExamSetId=${id}&userKey=${user.userKey}&Key=${keys}`
        // this.download(url)
        // this.$emit('download', url)
        this.$loading.show()
        this.$emit('download', url, function () {
          self.$loading.hide()
        })
      },
      download(url) {
        this.$emit('download', url)
      },
      lightHigh(timePoint) {
        let timeArray = timePoint.split('/')
        let monthArray = ['01月', '02月', '03月', '04月', '05月', '06月', '07月', '08月', '09月', '10月', '11月', '12月']
        return `
          <b style="font-size:16px;margin-right:2px;">${monthArray[parseInt(timeArray[1]) - 1]}${timeArray[2]}日</b>
        `
      },
      // 校长报告请求接口
      findMasterData(direction) {
        let timePoint = 0
        if (direction === this.LOAD) {
          if (this.tempExamList.length > 0) timePoint = this.tempExamList[this.tempExamList.length - 1].time
        }
        const url = this._url.schoolExamSet.finds
        const params = { timePoint: timePoint }
        this.$http.post(url, params).then(response => {
          if (response.body.status === 1) {
            let examList = response.body.result
            if (direction === this.LOAD) {
              if (examList.length !== 0 && this.tempExamList[this.tempExamList.length - 1].id !== examList[examList.length - 1].id) {
                this.tempExamList = [...this.tempExamList, ...examList]
              }
            } else {
              this.tempExamList = examList
            }
            this.examList = this.separateByYMD(this.tempExamList)
            this.examList.forEach(item => {
              for (let time in item.map) {
                item.map[time].forEach(child => {
                  let copyData = JSON.parse(JSON.stringify(this.typesList))
                  child.select = copyData
                })
              }
            })
            console.log(this.examList, 'this.examList')
            // 数据请求结束通知父组件
            this.$emit('finished', examList.length)
          }
        })
      },
      // 模拟数据请求
      minitorRequest(reqURL, options, cb) {
        const url = reqURL
        const params = options
        this.$http.post(url, params).then(response => {
          if (cb) cb(response)
        })
      },
      // 去除学困二字
      removefix(subname) {
        if (subname.indexOf('学困') > -1) return subname.replace('学困', '')
        else return subname
      },
      // 显示学科下载
      showSubjectModal(exam, index, time) {
        // debugger
        // 增加汇总字段
        // exam.subject.indexOf('汇总') == -1 ? exam.subject.push('汇总') : ''
        this.currents.time = time
        this.currents.index = index
        this.showDialog = true
        this.currentExam = exam
        this.subjects = exam.subject.map(subject => { return { name: subject, selected: false } })
        if (this.schoolCode == 'KTB779') {
          let temp = []
          this.subjects.forEach(item => {
            let obj = {}
            obj.selected = item.selected
            obj.name = item.name + '学困'
            temp.push(obj)
          })
          this.subjects = [...this.subjects, ...temp]
        }
      },
      // 归档报告
      exportAllWord(exam, time) {
        this.$confirm({
          title: '提示',
          message: '当前下载文件较大，耗时较长，是否下载？'
        }).then(() => {
          let self = this
          let user = this._util.getUser()
          let timePoint = time.replace(/\//g, '-')
          const filename = `${user.schoolName}${timePoint}${exam.typeDesc}.docx`
          const baseUrl = this.$baseUrl + '/word/check/exportAllWord'
          let params = {
            schoolExamSetId: exam.id,
            noLoading: true // 不显示loading加载
          }
          // 模拟
          this.$progress.showAuto(20)
          this.minitorRequest(baseUrl, params, function (res) {
            if (res.body) {
              self.$progress.finish()
            } else {
              self.$progress.downWrong()
            }
          })
          const requestUrl = `${baseUrl}?schoolExamSetId=${exam.id}&userKey=${user.userKey}&key=${filename}`
          this.$emit('download', requestUrl)
        }).catch(() => { })
      }
    }
  }
  </script>
  
  <style scoped lang="less">
  .pdf-master {
    font-size: 16px;
  }
  
  section {
    padding-bottom: 12px;
  
    h4 {
      font-size: 16px;
      padding: 8px 15px;
      margin-top: 0px;
      margin-left: -15px;
      margin-right: -15px;
      background-color: rgb(232, 232, 232);
    }
  
    h5 {
      margin-left: -15px;
      margin-right: -15px;
      padding: 0 15px 10px;
      font-size: 12px;
      margin-top: 0;
      border-bottom: 2px solid rgb(232, 232, 232);
  
      span:first-child {
        // text-shadow: 4px 4px 6px #aaa;
      }
  
      span:last-child {
        color: #fff;
        float: right;
        margin-top: 4px;
        font-size: 12px;
        padding: 2px 3px;
        border-radius: 2px;
      }
    }
  }
  
  section .year .time {
    float: left;
    // height: 145px;
    width: 250px;
    padding: 10px 15px 14px;
    margin: 10px 20px 12px 0;
    transition: box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  }
  
  section .year .group {
    font-size: 13px;
    margin: 15px 0;
  }
  
  section .year .group:last-of-type {
    margin-bottom: 5px;
  }
  
  section .year hr {
    margin-top: 15px;
    margin-bottom: -5px;
  }
  
  section .year .group a {
    width: 30%;
    float: left;
    padding: 6px 2px;
    text-align: center;
    margin-left: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 3px 4px 1px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  }
  
  section .year .group a:hover {
    text-decoration: none;
    box-shadow: 0 4px 6px 0 #f9dfdf, 0 0 0 1px #f9dfdf;
  }
  
  section .year .group a:nth-of-type(3n + 1) {
    margin-left: 0;
  }
  
  section .year .group a:nth-of-type(3n + 1):nth-last-of-type(-n + 3),
  section .year .group a:nth-of-type(3n + 1):nth-last-of-type(-n + 3)~a {
    margin-bottom: 0;
  }
  
  section .year .group a::after,
  section .year .subject::after {
    top: 0;
    right: 0;
    content: '';
    position: absolute;
    border-width: 5px;
    border-style: solid;
    border-color: #67afe9 #67afe9 transparent transparent;
  }
  
  section .year .group div {
    display: block;
    width: 100%;
    height: 4px;
    background: pink;
  }
  
  section .year .group .no-link {
    color: #aaa;
    width: 100%;
    padding: 6px;
    display: block;
    height: 52px;
    text-align: center;
  }
  
  section .year .subject {
    /*width: 100%;*/
    font-size: 14px;
    text-align: center;
    // padding: 10px 0px;
    padding-top: 10px;
    margin-bottom: -5px;
    margin-left: -15px;
    margin-right: -15px;
    position: relative;
    border-top: 1px solid #e8e8e8;
  }
  
  /* 弹窗  */
  .reminder {
    text-align: center;
    font-size: 15px;
  }
  
  .QRcode {
    text-align: center;
    height: 250px;
  }
  
  .dialog .item {
    width: 120px;
    height: 120px;
    cursor: pointer;
    display: inline-block;
  }
  
  .dialog .item>span {
    display: block;
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto;
  }
  
  .dialog .item img.subject {
    width: 100%;
    vertical-align: bottom;
  }
  
  .dialog .item img.yes {
    width: 18px;
    height: 18px;
    top: -5px;
    right: -8px;
    display: none;
    position: absolute;
  }
  
  .dialog .selected img.yes {
    display: block;
  }
  
  .dialog .item p {
    color: #aaa;
    margin: 10px 0 0;
    text-align: center;
  }
  
  .shadow-1,
  .shadow-4 {
    box-shadow: 2px 4px 12px -1px #ff4444;
  }
  
  .shadow-16 {
    box-shadow: 2px 4px 12px -1px rgb(253, 184, 163);
  }
  
  .shadow-18 {
    box-shadow: 2px 4px 12px -1px rgb(160, 217, 140);
  }
  
  .shadow-3,
  .shadow-6,
  .shadow-13 {
    box-shadow: 2px 4px 12px -1px #67afe9;
  }
  
  .shadow-2,
  .shadow-14,
  .shadow-17 {
    box-shadow: 2px 4px 12px -1px #00a045;
  }
  
  .shadow-6,
  .shadow-9,
  .shadow-11 {
    box-shadow: 2px 4px 12px -1px #ff6d46;
  }
  
  .shadow-5,
  .shadow-8,
  .shadow-12,
  .shadow-15 {
    box-shadow: 2px 4px 12px -1px #7444ff;
  }
  
  .dialog-content {
    width: 100%;
    display: flex;
    padding: 40px 10px;
  }
  
  .dialog-content span {
    margin: 0 auto;
    border-radius: 4px;
    width: 110px;
    color: #aaa;
    padding: 5px;
    text-align: center;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
    display: inline-block;
  }
  
  .dialog-content span div {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    margin-bottom: 10px;
  }
  
  .dialog-content span div.word {
    box-shadow: 0 4px 6px 0px rgba(128, 195, 249, 0.7);
    background-image: url(../../assets/img/word.png);
  }
  
  .dialog-content span div.excel {
    box-shadow: 0 4px 6px 0px rgba(36, 124, 76, 0.79);
    background-image: url(../../assets/img/excel.png);
  }
  
  .dialog-content span div.zip {
    box-shadow: 0 4px 6px 0px rgba(163, 54, 57, .7);
    background-image: url(../../assets/img/zip.png);
  }
  
  .dialog-content span b {
    font-weight: 300;
  }
  
  .dialog-content span img {
    display: none;
  }
  
  .dialog-content span.selected {
    position: relative;
  }
  
  .dialog-content span.selected img {
    top: 0;
    right: 0;
    width: 20px;
    margin: auto;
    display: block;
    z-index: 1001;
    position: absolute;
  }
  
  .setheight {
    height: 70px;
  }
  
  .selectedindex {
    position: relative;
  
    .olderes {
      position: absolute;
      width: 120px;
      left: 0px;
      right: 0px;
      text-align: left !important;
    }
  }
  
  .is_title {
    font-size: 18px;
    font-weight: 500;
    color: #333333;
    padding-left: 8px;
    margin-left: 20px;
    border-left: 3px solid #FDB51A;
  }
  
  .is_close {
    width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 4px;
    font-size: 18px;
    color: #3E4458;
    border: 1px solid #3E4458;
  }
  
  .is_success {
    width: 140px;
    height: 40px;
    font-size: 18px;
    color: #EDF1FF;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3E4458;
    border-radius: 4px;
    border: 1px solid #14244A;
  }
  </style>
  
  <style lang="scss" scoped>
  >>>.el-dialog {
    max-height: 800px;
    overflow-y: auto;
  }
  
  >>>.el-dialog__header {
    padding: 20px 0 17px 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }
  
  >>>.el-dialog__footer {
    padding: 20px;
    background: #FAFAFA;
  
    .dialog-footer {
      display: block;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
  
      .footer_text {
        font-size: 14px;
        color: #518DF1;
      }
  
      .footer_button {
        display: flex;
        align-items: center;
      }
    }
  }
  
  .is_active_label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 75px;
  
    .text {
      font-size: 18px;
      color: #333333;
      font-weight: 600;
    }
  
    .is_right {
      .is_up {
        width: 190px;
        height: 40px;
        text-align: center;
        line-height: 40px;
        background: #FFFFFF;
        font-size: 14px;
        color: rgba($color: #333, $alpha: .43);
        border-radius: 2px;
        border: 1px dashed #D9D9D9;
      }
    }
  }
  
  .is_content {
    max-height: 400px;
    overflow-y: scroll;
    margin-top: 40px;
    padding: 15px 20px 15px 30px;
    border: 1px solid #EBEEF7;
    border-radius: 4px;
    background: #F5F7FA;
  
    .is_report {
      display: flex;
      align-items: flex-start;
      margin-bottom: 20px;
  
      .is_content_flex {
        display: flex;
        flex-wrap: wrap;
      }
  
      .is_text {
        width: 70px;
        max-width: 70px;
        font-size: 14px;
        font-family: PingFangSC-Semibold, PingFang SC;
        color: #333333;
      }
  
      .is_text_not {
        color: rgba($color: #333, $alpha: .6);
      }
  
      .is_icon {
        padding: 0 20px 0 15px;
      }
  
      .is_report_label {
        display: flex;
        align-items: center;
      }
    }
  }
  
  .is_all_content {
    margin-top: 0;
  }
  
  .is_left {
    cursor: pointer;
    width: 190px;
    min-width: 190px;
    height: 40px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 10px;
    background: #F9FAFE;
    border-radius: 2px;
    border: 1px solid #D9D9D9;
  
    .plan {
      color: #fff;
      // background-color: #F6FFED;
      padding: 0 4px;
      // border: 1px solid #BCEC95;
    }
  
    .time {
      color: #333333;
      font-weight: 600;
    }
  
    .is_name {
      width: 130px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
  
      color: #333333;
      font-weight: 600;
    }
  
    .close {
      font-size: 7px;
      color: #000000;
      opacity: 1;
    }
  
    .add {
      width: 16px;
      font-size: 11px;
      color: rgba(0, 0, 0, 0.45);
      cursor: pointer;
    }
  }
  
  .mar_right {
    margin-right: 10px;
    background: #FFFFFF;
    margin-bottom: 10px;
  
  }
  
  .is_active {
    background: #F6FFED;
  
    .check_active {
      width: 16px;
      height: 16px;
      text-align: center;
      line-height: 16px;
      color: #fff;
      border-radius: 50%;
      background: #f56c6c;
  
      i {
        margin-left: 2px;
      }
    }
  }
  
  .not_active {
    .time {
      font-weight: 400;
      color: rgba($color: #333, $alpha: .3);
    }
  }
  
  .type_desc {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .filter {
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    position: absolute;
    right: 45px;
  
    .filterWrap {
      display: flex;
      align-items: center;
  
      .Text {
        color: #606266;
      }
    }
  
    .filterimg {
      width: 20px;
    }
  }
  
  .selectItem {
    height: 35px;
  }
  
  .genzon {
    padding-bottom: 5px;
    padding-left: 15px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
  }
  </style>
  